package cn.tx;

import javax.swing.*;
import java.awt.*;

public class DrawPanel extends JPanel {
    //构造器
    public DrawPanel(){
        init();
    }
    JPanel panel = new JPanel();
    public void init(){
        //设置流式布局
        this.setLayout(new FlowLayout(FlowLayout.LEFT));
        //设置底色
        this.setBackground(Color.LIGHT_GRAY);
        //设置画图的白色
        panel.setBackground(Color.WHITE);
        //设置画布的大小
        panel.setPreferredSize(new Dimension(600,600));
        this.add(panel);
    }
}
